package com.xizimall.portal.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xizimall.portal.service.ContentService;
import com.xizimall.common.pojo.XizimallResult;

@Controller
public class IndexController {
	
	@Autowired
	
	private ContentService contentService;
    @RequestMapping("/index")
    public String showIndex(Model model){
    	String adJson=contentService.getContentList();
    	model.addAttribute("ad1",adJson);
    	return "index";
    }
    @RequestMapping(value="/httpclient/post",method=RequestMethod.POST)
    @ResponseBody
    public XizimallResult testPost(String username,String password){
    	String result= "username:"+username+"\tpassword:"+password;
    	System.out.println(result);
    	return XizimallResult.ok(result);
    }
}
